package com.haochang.chunkvod.tools.vod.other;

import com.haochang.chunkvod.view.vod.imageSpan.VerticalImageSpan;

import android.content.Context;
import android.graphics.drawable.Drawable;
import android.text.Spannable;
import android.text.SpannableString;

/**
 *@author qintao
 *created at 2016/6/25 17:14
 * 给字体末尾追加图片
 */

public class AppendImageUtil
{
	public static SpannableString addImageSpan(Context context, int imageID, int left)
	{
		SpannableString spanString = new SpannableString(" ");
		Drawable d = context.getResources().getDrawable(imageID);
		d.setBounds(left, 0, d.getIntrinsicWidth() + left, d.getIntrinsicHeight());
		VerticalImageSpan span = new VerticalImageSpan(d);
		spanString.setSpan(span, 0, 1, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
		return spanString;
	}
}
